<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>用户登录</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f4f4f4;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            margin: 0;
        }
        .container {
            background-color: #fff;
            padding: 40px;
            border-radius: 8px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
            width: 300px;
            text-align: center;
        }
        h1 {
            margin-bottom: 20px;
            color: #333;
        }
        .form-group {
            margin-bottom: 20px;
            text-align: left;
        }
        label {
            display: block;
            margin-bottom: 5px;
            color: #555;
        }
        input[type="text"],
        input[type="password"] {
            width: 100%;
            padding: 10px;
            border: 1px solid #ccc;
            border-radius: 4px;
            box-sizing: border-box;
        }
        .error-message {
            color: red;
            margin-bottom: 20px;
        }
        button {
            background-color: #007bff;
            color: #fff;
            padding: 10px 20px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            width: 100%;
            font-size: 16px;
        }
        button:hover {
            background-color: #0056b3;
        }
        .btn-secondary {
            display: block;
            margin-top: 20px;
            text-decoration: none;
            color: #007bff;
        }
        .btn-secondary:hover {
            text-decoration: underline;
        }
    </style>
</head>
<body>
<div class="container">
    <h1>用户登录</h1>
    <form action="/user/login" method="post">
        <div class="form-group">
            <label for="loginname">登录名:</label>
            <input type="text" id="loginname" name="loginname" required>
        </div>
        <div class="form-group">
            <label for="password">密码:</label>
            <input type="password" id="password" name="password" required>
        </div>
        <div class="error-message">
            <span th:if="${error != null}" th:text="${error}"></span>
        </div>
        <button type="submit">登录</button>
        <br>
        <a th:href="@{/user/resetpasword}" class="btn-secondary">重置密码</a>
    </form>
</div>
</body>
</html>